import React, { Component } from 'react'

// 默认值
function Title (props) {
  return (
    <h1>
      标题 - { props.name } - { props.a }
    </h1>
  )
} 
// 函数式组件的默认值在定义完组件之后
Title.defaultProps = {
  a: 100
}

class Content extends Component {
  // 类组件的属性的默认值
  static defaultProps = {
    room: 'sz2107'
  }
  render () {
    return (
      <section>
        内容 - { this.props.name } - { this.props.room }
      </section>
    )
  }
}
class App extends Component {
  render() {
    return (
      <>
        <Title name="title"></Title>
        <Content name="content"></Content>
      </>
    )
  }
}

export default App
